﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pgAlertas.aspx.cs" Inherits="EGuayas.Web.Auditoria.pgAlertas" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title><link  href="~/Resources/css/Style.css"  rel="stylesheet" /><!-- Load Ext JS --> <script src="../../Resources/js/Global.js"></script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
    <Items>
         <ext:FormPanel ID="FormPanel1" runat="server" Region="Center" Layout="VBoxLayout" >
                    <LayoutConfig>
                            <ext:VBoxLayoutConfig Align="Stretch" />
                    </LayoutConfig>
                    <Items>
                        <ext:Panel ID="Panel1" 
                            runat="server" 
                            Title="Alertas"
                            Icon="PackageGo"
                            Margins="5 5 5 5" 
                            Flex="1"
                            Layout="FitLayout"
                            BodyBorder="0"                           
                            Collapsible="true">
                            <Items>
                                        <ext:GridPanel
                                            ID="GridPanel1"
                                            runat="server" 
                                            Width="620" 
                                            Height="90">
                                            <Store>
                                                <ext:Store ID="Store1" runat="server">
                                                    <Model>
                                                        <ext:Model ID="Model1" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="IntField" Type="Int" />
                                                                <ext:ModelField Name="ComboField" Type="Int" />
                                                                <ext:ModelField Name="TextField" Type="String" />
                                                                <ext:ModelField Name="DateField" Type="Date" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>                                      
                                                    <Proxy>
                                                        <ext:PageProxy DirectFn="App.direct.BindData">
                                                            <Reader>
                                                                <ext:ArrayReader />
                                                            </Reader>
                                                        </ext:PageProxy>
                                                    </Proxy>
                                                </ext:Store>
                                            </Store>
                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                <Columns>
                                                    <ext:Column ID="Column1" runat="server" Text="Asunto" DataIndex="TextField" Flex="1" />
                                                    <ext:DateColumn ID="DateColumn2" runat="server" Text="Fecha" Width="95" DataIndex="DateField" Format="H:mm:ss" />
                                                    <ext:CommandColumn ID="CommandColumn0" runat="server" Width="120" Text="">
                                                                    <Commands>
                                                                        <ext:GridCommand Icon="Zoom" CommandName="View" Text="Vizualizar">
                                                                            <ToolTip Text="Vizualizar" />
                                                                        </ext:GridCommand>
                                                                    </Commands>
                                                                    <PrepareToolbar />
                                                                    <Listeners>
                                                                           <Command Handler="AppGlobalJs.showPdf('../../..',record.data.urlPdf);" />
                                                                    </Listeners>                                                       
                                                    </ext:CommandColumn>
                                                    
                                                </Columns>
                                             </ColumnModel> 
                                             <Plugins>
                                                <ext:BufferedRenderer ID="BufferedRenderer1" runat="server" />
                                            </Plugins>   
                                            <View>
                                                <ext:GridView ID="GridView2" runat="server" TrackOver="false" />
                                            </View>                   
                                        </ext:GridPanel>                               
                            </Items>
                        </ext:Panel> 
                    </Items>
                 
       </ext:FormPanel>
      <ext:Window 
            ID="winVisor" 
            runat="server"            
            Icon="PackageGo"
            Height="285" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="forPanelMsg" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                    <FieldDefaults LabelWidth="75" LabelPad="20" LabelSeparator="" />
                    <Items>   
                        <ext:TextField ID="TextField1" Name="pctChange" runat="server" FieldLabel="Asunto" />
                        <ext:DateField ID="dfFechaInicio" Name="lastChange" runat="server" FieldLabel="Fecha" />
                        <ext:TextField ID="TextField2" Name="pctChange" runat="server" FieldLabel="Expediente" />
                        <ext:TextArea ID="TextArea1"   runat ="server"  Note="Nota" FieldLabel="Mensaje"  />
                    </Items>
                    <Listeners>
                        
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                  <ext:Button ID="Button5" runat="server" Text="Aceptar"  OnClientClick="AppGlobalJs.closeWin(#{winVisor})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelMsg}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>

    </Items>
   </ext:Viewport>
   <ext:XScript ID="XScript1" runat="server">
    <script type="text/javascript">
        var pgFn = new Object();
        pgFn.presentaMensaje = true;

        pgFn.Test = function () {
            alert("OK");
        };
        AppGlobalJs.showWin = function (objwin) {
            objwin.show();
        };
        AppGlobalJs.closeWin = function (objwin) {
            objwin.hide();
        };
        pgFn.menuItemClick = function (menu, item) {
            App.PnlCenter.body.update(Ext.String.format("Clicked: {0}", item.text)).highlight();
        };
 </script>
</ext:XScript> 
</body>
</html>
